-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(search-bar): Add consent flow to Ask Seer #95406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(search-bar): Add consent flow to Ask Seer #95406
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #95406 +/- ##
=======================================
Coverage 86.50% 86.50%
=======================================
Files 10563 10563
Lines 608782 608753 -29
Branches 23912 23908 -4
=======================================
- Hits 526614 526591 -23
+ Misses 81873 81868 -5
+ Partials 295 294 -1 |
This is incorrect, and actually caused a bug. const openState = isOpen ?? state.isOpen;
if (hasCustomMenu) {
return openState;
}
// When a custom menu is not being displayed and we aren't loading anything,
// only show when there is something to select from.
return openState && totalOptions > hiddenOptions.size; We need to only add one of the two, or else when searching free text, the condition will never be met properly. I attempted to switch from |
2a0d2b3
to
b499912
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also should not be showing any Seer UI, not even the consent entry point, if organization.hideAiFeatures
is true
{ | ||
dataProcessingPolicy: ( | ||
<TooltipSubExternalLink | ||
onMouseOver={() => setOptionDisableOverride(true)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you disabling to prevent the click here from propagating to the option?
In other areas, I've added stopPropagation to the necessary handlers to prevent the click from going through:
sentry/static/app/components/searchQueryBuilder/tokens/filter/valueCombobox.tsx
Lines 501 to 505 in 119d3f3
<TrailingWrap | |
onPointerUp={e => e.stopPropagation()} | |
onMouseUp={e => e.stopPropagation()} | |
onClick={e => e.stopPropagation()} | |
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. The reason why this is needed is because of the logic that lives inside these lines: https://github.com/getsentry/sentry/blob/nd/AIML-704/feat-add-consent-flow-to-trace-ask-seer/static/app/components/searchQueryBuilder/tokens/filterKeyListBox/useFilterKeyListBox.tsx#L388-L404, there doesn't seem to be any way to access the event in this handler, so can't call stopPropagation
, there it would seem
As the onClick
handler in askSeer.tsx
isn't used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still add onMouseUp={e => e.stopPropagation()}
(and others if necessary) to the <TooltipSubExternalLink>
though right? That would prevent the option from being selected when you click the link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that doesn't work annoyingly, it's still triggering the option via useFilterKeyListBox
Yep, any cases of where |
b969f87
to
7797141
Compare
…y selection dropdown
d3bd864
to
4eb8681
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Ask Seer Options Incorrectly Displayed
The useHiddenItems
hook in combobox.tsx
incorrectly hides only one of the Ask Seer options (ASK_SEER_ITEM_KEY
or ASK_SEER_CONSENT_ITEM_KEY
) based on the gaveSeerConsent
status. Both options should always be hidden from the main dropdown list, as the appropriate Ask Seer prompt is rendered separately by the AskSeer
component. This causes the wrong Ask Seer option to appear as a duplicate in the main results list.
static/app/components/searchQueryBuilder/tokens/combobox.tsx#L192-L200
sentry/static/app/components/searchQueryBuilder/tokens/combobox.tsx
Lines 192 to 200 in bb15ff3
); | |
if (showAskSeerOption) { | |
if (gaveSeerConsent) { | |
options.add(ASK_SEER_ITEM_KEY); | |
} else { | |
options.add(ASK_SEER_CONSENT_ITEM_KEY); | |
} | |
} |
Was this report helpful? Give feedback by reacting with 👍 or 👎
This PR adds in the consent flow for Ask Seer, as well as the associated tests for these changes. This enables users to turn on Ask Seer to help them generate queries while searching on the explore/traces page.
Ticket: AIML-704